
<div class="comment-widget">
  <div class="comment-edit">
    <form id="commentform_<?php echo $stid;?>" method="post" action="<?php echo url('shop/Snshome/addcomment');?>">
      <input type="hidden" name="stid" value="<?php echo $stid;?>" />
      <input type="hidden" name="showtype" value="<?php echo $showtype;?>" />
      <div class="comment-add">
        <textarea placeholder="我也插句话..." resize="none" id="content_comment<?php echo $stid;?>" name="commentcontent"></textarea>
        <span class="error"></span> 
        <!-- 验证码 -->
        <div id="commentseccode<?php echo $stid;?>" class="seccode">
          <label for="captcha">验证码：</label>
          <input name="captcha" class="text" type="text" size="4" maxlength="4"/>
          <img src="" title="点击更换验证码" name="codeimage" onclick="this.src='<?php echo url(\'verify_code\');?>?t=' + Math.random();"/> <span>您的操作过度频繁，请输入验证码后继续。</span>
          <input type="hidden" name="nchash" value="<?php echo $nchash;?>"/>
        </div>
        <input type="text" style="display:none;" />
        <!-- 防止点击Enter键提交 -->
        <div class="act"> 
        	<span class="skin-blue">
        		<!--<span class="btn">
        			<a href="javascript:void(0);" nc_type="scommentbtn" data-param='{"txtid":"<?php echo $stid;?>"}'>评论</a>
        	
        			</span>-->
        	</span> 
        	<!--<span id="commentcharcount<?php echo $stid;?>" style="float:right;"></span> 
        	<a class="face" nc_type="smiliesbtn" data-param='{"txtid":"comment<?php echo $stid;?>"}' href="javascript:void(0);" >表情</a> -->
        </div>
      </div>
    </form>
  </div>
  <div class="clear"></div>
  <?php if (count($commentlist)>0){ ?>
  <ul class="comment-list">
    <?php if(is_array($commentlist)){?>
    <?php foreach ($commentlist as $k=>$v){?>
    <li nc_type="commentrow_<?php echo $v['scomm_id']; ?>"> 
    	<a target="_blank" href="<?php echo url('member/Snshome/index');?>?mid=<?php echo $v['scomm_memberid'];?>">
    		<img width="30" height="30" class="clogo" src="<?php if ($v['scomm_memberavatar']!='') { echo UPLOAD_PATH.DS.$v['scomm_memberavatar']; } else {  echo UPLOAD_PATH.DS.C('default_user_portrait'); } ?>" onload="javascript:DrawImage(this,30,30);"></a>
      <div class="detail">
        <p class="words"><a target="_blank" href="<?php echo url('member/Snshome/index');?>?mid=<?php echo $v['scomm_memberid'];?>" class="name"><?php echo $v['scomm_membername'];?></a>：<?php echo parsesmiles($v['scomm_content']);?></p>
        <p class="other">
          <?php if (session('member_id') == $v['scomm_memberid']){?>
          <span class="opt"><a href="javascript:void(0);" nc_type="scomment_del" data-param='{"scid":"<?php echo $v['scomm_id'];?>","stid":"<?php echo $v['strace_id'];?>"}'>删除</a></span>
          <?php }?>
          <span class="time"><?php echo @date('Y-m-d H:i',$v['scomm_time']);?> - <?php echo $countnum-$k;?>&nbsp;楼</span> </p>
      </div>
    </li>
    <?php }?>
    <?php }?>
  </ul>
  <?php if ($showtype==1 && $showmore == '1'){//展示更多连接?>
  <div class="more"><a target="_blank" href="<?php echo url('shop/Showsnshome/straceinfo');?>?st_id=<?php echo $stid;?>">查看更多评论</a></div>
  <?php } elseif (!$showtype){//展示分页?>
  <div class="pagination"><?php echo $show_page; ?></div>
  <?php } ?>
  <?php } ?>
  <div style="clear:both;"></div>
</div>
<script type="text/javascript">
var MAX_RECORDNUM = <?php echo $max_recordnum;?>;
$(function(){
	$('#commentform_<?php echo $stid;?>').validate({
		errorPlacement: function(error, element){
			element.next('.error').append(error);
	    },      
	    rules : {
	    	commentcontent : {
	            required : true,
	            maxlength : 140
	        }
	    },
	    messages : {
	    	commentcontent : {
	            required : '需要评论点内容~',
	            maxlength: '不能超过140字'
	        }
	    }
	});
	<?php if (!$output['showtype']==1){?>
	//分页绑定异步加载事件
	$('#tracereply_<?php echo $stid;?>').find('.demo').ajaxContent({
		event:'click',
		loaderType:"img",
		loadingMsg:"__SHOP_DEFAULT__/images/transparent.gif",
		target:'#tracereply_<?php echo $stid;?>'
	});
	<?php }?>
	//评论字符个数动态计算
	$("#content_comment<?php echo $stid;?>").charCount({
		allowed: 140,
		warning: 10,
		counterContainerID:'commentcharcount<?php echo $stid;?>',
		firstCounterText:'还可以输入',
		endCounterText:'字',
		errorCounterText:'已经超出'
	});
});
</script>